package org.stone.project.quartzIntegration.pojo.sysEnum;

/**
 * 定时任务策略枚举
 */
public enum MisfirePolicyEnum {
    MISFIRE_DEFAULT(0,"默认"),
    MISFIRE_IGNORE_MISFIRES(1,"立即触发执行"),
    MISFIRE_FIRE_AND_PROCEED(2,"触发一次执行"),
    MISFIRE_DO_NOTHING(3,"不触发立即执行"),
    ;
    private Integer code;
    private String describStr;

    MisfirePolicyEnum(Integer code, String describStr) {
        this.code = code;
        this.describStr = describStr;
    }


    public Integer getCode() {
        return code;
    }

    public String getDescribStr() {
        return describStr;
    }


    /**
     * 根据code获取实例
     * @param code
     * @return
     */
    public static MisfirePolicyEnum getInstance(Integer code){
        if (code == null)
            return null;
        for (MisfirePolicyEnum value : values()) {
            if (value.getCode().equals(code))
                return value;
        }
        return null;
    }
}
